package cn.wolfcode.qo;

import cn.hutool.core.date.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
public class NoticeQueryObject extends QueryObject {
    //阅读状态
    private Boolean isRead;
    //公告等级
    private Integer grade;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date minCreateDate;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date maxCreateDate;

    public Date getMaxCreateDate(){
        if(maxCreateDate == null){
            return null;
        }
        return DateUtil.endOfDay(maxCreateDate);
    }
}
